/**
 * 
 */
package com.css.crm.dao.impl;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.CustomerActivityDao;
import com.css.crm.vo.CustomerActivityVo;

/**
 * Implementation for CustomerActivityDao
 * 
 * @author AIS
 * 
 */
public class CustomerActivityDaoImpl extends BaseDaoImpl implements CustomerActivityDao {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerActivityDao#getCustomerActivityByPK(java.lang
	 * .String)
	 */
	@Override
	public CustomerActivityVo getCustomerActivityByPK(String custId) {
		SqlSession session = getMyBatisSession();
		return session.selectOne("customerActivity.getCustomerActivityByPK", custId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerActivityDao#insertCustomerActivity(com.css.crm
	 * .vo.CustomerActivityVo)
	 */
	@Override
	public int insertCustomerActivity(CustomerActivityVo customerActivity) {
		SqlSession session = getMyBatisSession();
		return session.insert("customerActivity.insertCustomerActivity", customerActivity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerActivityDao#updateCustomerActivityByPK(com.css
	 * .crm.vo.CustomerActivityVo)
	 */
	@Override
	public int updateCustomerActivityByPK(CustomerActivityVo customerActivity) {
		SqlSession session = getMyBatisSession();
		return session.update("customerActivity.updateCustomerActivityByPK", customerActivity);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerActivityDao#deleteCustomerActivityByPK(java.lang
	 * .String)
	 */
	@Override
	public int deleteCustomerActivityByPK(String custId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerActivity.deleteCustomerActivityByPK", custId);
	}

}
